package com.interesting.examsystem.common.core.model;

import org.hibernate.validator.constraints.Range;

import java.io.Serializable;

/**
 * @author ：ZXY
 * @date ：Created in 2021/2/22 17:31
 * @description：
 * @modified By：`
 * @version: 1.0
 */
public class BaseDTO
        implements Serializable {
    private static final long serialVersionUID = 8993571607402946091L;

    public long getPageNo() {
        return this.pageNo;
    }

    public long getPageSize() {
        return this.pageSize;
    }

    public String getSortMapJson() {
        return this.sortMapJson;
    }

    public void setPageNo(long pageNo) {
        this.pageNo = pageNo;
    }

    public void setPageSize(long pageSize) {
        this.pageSize = pageSize;
    }

    public void setSortMapJson(String sortMapJson) {
        this.sortMapJson = sortMapJson;
    }

    public boolean equals(Object o) {
        if (o == this) return true;
        if (!(o instanceof BaseDTO)) return false;
        BaseDTO other = (BaseDTO) o;
        if (!other.canEqual(this)) return false;
        if (getPageNo() != other.getPageNo()) return false;
        if (getPageSize() != other.getPageSize()) return false;
        Object this$sortMapJson = getSortMapJson(), other$sortMapJson = other.getSortMapJson();
        return !((this$sortMapJson == null) ? (other$sortMapJson != null) : !this$sortMapJson.equals(other$sortMapJson));
    }

    protected boolean canEqual(Object other) {
        return other instanceof BaseDTO;
    }

    public int hashCode() {
        int PRIME = 59,
        result = 1;
        long $pageNo = getPageNo();
        result = result * 59 + (int) ($pageNo ^ $pageNo >>> 32);
        long $pageSize = getPageSize();
        result = result * 59 + (int) ($pageSize ^ $pageSize >>> 32);
        Object $sortMapJson = getSortMapJson();
        return result * 59 + (($sortMapJson == null) ? 43 : $sortMapJson.hashCode());
    }

    public String toString() {
        return "BaseDTO(pageNo=" + getPageNo() + ", pageSize=" + getPageSize() + ", sortMapJson=" + getSortMapJson() + ")";
    }

    @Range(min = 1L)
    private long pageNo = 1L;

    @Range(min = 0L, max = 1000L)
    private long pageSize = 10L;
    private String sortMapJson;
}
